<!DOCTYPE html>
<html ><head ><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
    <title>重置密码</title>
    
		<link href="../css/themes/default/easyui.css" rel="stylesheet" />
    <link href="../css/screen.css" type="text/css" rel="stylesheet">
		<script type="text/javascript" src="../script/jquery.min.js"></script>
    <link href="../css/bootstrap.min.css" type="text/css" rel="stylesheet"/>
		<script src="../script/jquery.easyui.min.js"></script>
		<script src="../script/jquery.cookie.js"></script>
   </head>

  <body>
    <div class="openlab-masthead">
      <div class="container">
        <div class="logo col-sm-2">
          <img src="../img/logo.gif">
        </div>
        <div class="col-sm-7">
          <p class="openlab-slogan">
            我们曾经走过一样的岁月，也曾经为一样的事情流泪和欢笑，<br>
            我们宁愿忽视那些不同的想法和生活方式；<br>
            我们坚信，虽然我们的样子已经被社会打磨成千面，但是体温相似，情有共通。
          </p>
        </div>
          <div class="header-profile">
          </div>
      </div>
    </div>
    
    <div class="openlab-navbar">
      <div class="container">
        <ul class="openlab-nav">
          <li class="active"><a href=""><i class="glyphicon glyphicon-home"></i> 首页</a></li>
					<li class="active"><a href="login.html"><i class="glyphicon glyphicon-home"></i> 登陆</a></li>
        </ul>
  </div>
    </div>
    <div class="container openlab-main">

      


<div class="row">
    <div class="col-sm-offset-4 col-sm-4">
        <form class="form-signin" >
            <h2 class="form-heading">重置密码</h2>
            <hr>
                <div class="form-group ">
                <label for="username">输入密码</label>
                <input class="form-control" id="password" maxlength="30"  placeholder="输入密码" type="password" value="" onchange="checkPw()">
                <span class="help-block" style="color: red;" id="pwMsg"></span>
            </div>
            <div class="form-group ">
                <label for="password">确认密码</label>
                <input class="form-control" id="rpassword" maxlength="20"  placeholder="确认密码" type="password" value="" onchange="checkrPw()">
                <span class="help-block" style="color: red;" id="rpwMsg"></span>
            </div>
            <button class="btn btn-lg btn-primary btn-block" onclick="findPw()" type="button">找回密码</button>
        </form>

    </div>
	<script type="text/javascript">
		function checkPw()
		{
			if($("#password").val()=="")
			{
				$("#pwMsg").html("×该项不能为空！！");
				return false;
			}else
			{
				$("#pwMsg").html("");
				return true;
			}
		}
		function checkrPw()
		{
			if($("#rpassword").val()=="")
			{
				$("#rpwMsg").html("×该项不能为空！！");
				return false;
			}else
			{
				if($("#rpassword").val()==$("#password").val())
				{
					$("#rpwMsg").html("");
					return true;
				}else{
					$("#rpwMsg").html("×两次密码输入不一样！！");
					return true;
				}
			}
		}
	function checkAll()
	{
		if(!checkPw())
		{
			return false;
		}
		if(!checkrPw())
		{
			return false;
		}
		return true;
	}
	function findPw()
	{
		if(checkAll())
		{
			var pars=
			{
				password:$("#password").val(),
				uuid:$.cookie('uuidc')
			}
			$.ajax({
				type:"post",
				contentType :'application/json;charset=utf-8',
				dataType:"json",  //数据格式设置为jsonp
				url : 'http://localhost:8080/libManager/user/changePWByFind.do',
				xhrFields:{
					withCredentials:true
				},
				data:JSON.stringify(pars), //额外的参数
				success:function (data) 
				{
					if(data.status==1)
					{
						$.cookie('uuidc', null);
						$.messager.alert('系统提示', data.msg);
						$(location).attr('href', 'login.html');
					}else
					{
						$.messager.alert('系统提示', data.msg);
					}
				}
			});
		}else
		{
			$.messager.alert("系统提醒","部分信息没有完善或格式不对！！");
		}
	}
	</script>
</body></html>